package com.mes.biz.service.impl;

import java.util.List;
import org.springframework.stereotype.Service;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.pagehelper.PageInfo;
import com.mes.common.core.domain.BaseEntity;
import com.mes.common.core.service.BaseServiceImpl;
import com.mes.biz.mapper.BizStockMapper;
import com.mes.biz.domain.BizStock;
import com.mes.biz.service.BizStockService;
import org.springframework.transaction.annotation.Transactional;

/**
 * 商品库存Service业务层处理
 * @author wy
 * @email wy
 * @date 2023-05-24
 */
@Service
@Transactional(readOnly = true)
public class BizStockServiceImpl extends BaseServiceImpl<BizStockMapper, BizStock> implements BizStockService {

    private static final Logger log = LoggerFactory.getLogger(BizStockServiceImpl.class);

    /**
     * 获取单条数据
     * @param bizStock 商品库存
     * @return 商品库存
     */
    @Override
    public BizStock get(BizStock bizStock) {
        BizStock dto = super.get(bizStock);
        return dto;
    }

    /**
     * 获取单条数据
     * @param id 商品库存id
     * @return 商品库存
     */
    @Override
    public BizStock get(String id) {
        BizStock dto = super.get(id);
        return dto;
    }

    /**
     * 查询商品库存列表
     * @param bizStock 商品库存
     * @return 商品库存
     */
    @Override
    public List<BizStock> findList(BizStock bizStock) {
		List<BizStock> bizStockList = super.findList(bizStock);
        return bizStockList;
    }

    /**
     * 分页查询商品库存列表
     * @param bizStock 商品库存
     * @return 商品库存
     */
    @Override
    public PageInfo<BizStock> findPage(BizStock bizStock) {
		PageInfo<BizStock> page = super.findPage(bizStock);
        return page;
    }

    /**
     * 保存商品库存
     * @param bizStock
     * @return 结果
     */
    @Override
    public boolean save(BizStock bizStock) {
        return super.save(bizStock);
    }

    /**
     * 删除商品库存信息
     * @param bizStock
     * @return 结果
     */
    @Override
    public boolean remove(BizStock bizStock) {
        return super.remove(bizStock);
    }

    /**
     * 批量删除商品库存
     * @param ids 需要删除的商品库存ID
     * @return 结果
     */
    @Transactional(readOnly = false)
    @Override
    public int deleteBizStockByIds(String[] ids) {
        return mapper.deleteBizStockByIds(ids, BaseEntity.DEL_FLAG_DELETE);
    }

}
